#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <netinet/ether.h>

void handle_ieee_802_3x(const unsigned char *data)
{
    static int cnt = 0;
    const struct ethhdr  *hdr = (struct ethhdr *) data;
    char src[18];
    char dest[18];
    strncpy(src, ether_ntoa((struct ether_addr *)hdr->h_source), 18);
    strncpy(dest, ether_ntoa((struct ether_addr *)hdr->h_dest), 18);
    printf("% 4d proto=%04X %s -> %s\n", ++cnt, ntohs(hdr->h_proto), src, dest);
}
